<%@page import="servlet.CommitteeTable2"%>
<%@page import="servlet.CommitteeFilterDropdown"%>
<%@page import="Logic.Authorizer"%>
<%@ page import="Model.Committee,java.util.*" %>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%
	if (session.getAttribute("name") == null) {
		response.sendRedirect("login.jsp");
	} 
%>


<!-- Declare the first header -->
<jsp:include page="t_header.jsp" />

<link rel="stylesheet" type="text/css" href="css/demo.css" />
<link rel="stylesheet" type="text/css" href="css/basic.css" />
<script type="text/javascript" src="js/jquery.simplemodal.js"></script>
<script type="text/javascript" src="js/basic.js"></script>
<style type="text/css" >
#committeeapprovedlist
{
    border-radius:3px;
}


.tdmar1 {
text-align:center;


margin-bottom:35px;


font-size: 18pt;

display: block;



margin-start: 0;
margin-end: 0;
font-weight: bold;

	color: #1F1F20;
	text-transform: uppercase;
	text-shadow: 0 1px 0 #fff;
	font-size: 13px;
	
	display: block;
margin-left:20px;
	float: left;
margin-top:10px;
}
.tdmar2 {

margin-bottom:35px;
}
.tdmar3 {

margin-bottom:35px;
}
</style>

<script type="text/javascript">

function getResponsiblity(){
	var value = document.getElementById("getResponsiblity");
	alert(value.value);
}

$(document).ready(function(){
	$(".committeeapprovedlist").change(function(){
		
		var value = this.value;
		
		if (value == "all"){
			$(".approvedcommitteebody tr").show();
		}
		
		else{
		$(".approvedcommitteebody tr").show();
		$(".approvedcommitteebody tr").not("." +value).hide();
		}
	});
});
</script>


<jsp:include page="header.html" />


<!-- Declare sidebar -->
<jsp:include page="t_siderbarcommittee.jsp" />

<!-- Main Content -->
<section id="main" class="column">

	<article class="module width_full">
		
		
		<header>
		<table   style="{border-spacing: 0; }">
		<tr>
	
		<td  style="width:40%; ">
		
		<h3 >View Committee</h3>
	
		</td>
		
		<td  style="width:20%; right:255px;   position:absolute;   "><p class="tdmar2" >View by Committee:</p></td>
		
		<td style="width:40%; right:5px; margin-top:3px; position:absolute;  "><select id="committeeapprovedlist" class="committeeapprovedlist tdmar3" style="width:100%; float: left;">
						<%
								CommitteeFilterDropdown atd = new CommitteeFilterDropdown(out);
								atd.doGet(request, response);
						%>
		</select></td>
	
		
		</tr>
		</table></header>
		


		<table class="tablesorter" cellspacing="0">
			<thead>
				<tr>
					<th style="width:15%">Title</th>
					<th style="width:22%">Purpose</th>
					<th>Roles</th>
					<th>Staff</th>
					<th style="width:15%">Effective Date</th>
					<th style="width:3%">Print</th>
					
				</tr>
			</thead>
			<tbody class="approvedcommitteebody">
			<% 
				ArrayList<Committee> comArr = new ArrayList<Committee>();
				comArr = Committee.getApprovedCommittees();
				for(Committee com : comArr)
				{
					ArrayList<String> staffName = com.getStaffList();
					ArrayList<String> roleList = com.getRoles();
			%>
				<tr id="commTable2" class=<%=com.getId()%>>
					<td><%= com.getTitle() %></td>
					<td><%= com.getPurpose() %></td>
					<td><% for (int q = 0; q < roleList.size();q++){%>
					<%= roleList.get(q) %><br/>
					<% } %>
					</td>
					<td><% for(int j=0; j < staffName.size();j++){ %><%= staffName.get(j) %><br/><%} %></td>
					<td><%= com.getDate() %></td>
					<td><a target="_blank" href="CommitteePrint?id=<%= com.getId() %>">Print</a></td>
				</tr>
				<%} %>
			</tbody>
		</table>


	</article><!-- end of content manager article -->
		<div class="spacer">
		</div>
	</section>
	
	

<!-- Declare closing tags -->
<jsp:include page="t_footer.jsp"/>